// pages/dynamic/more-comment.js
const app = getApp()
Page({
    data: {

    },
    onLoad: function (options) {

    },
    onShow() {
        this.setData({
            item: getApp().moreComment
        })
    },
    likeClick(evt) {
        let { index, id } = evt.currentTarget.dataset
        if (this.data.item.has_kike) {
            return
        }

        app.http.get('shop-circle/circle-like', {
            data: {
                id: id
            }
        }).then(res => {
            let c = this.data.item.lick_num;
            this.setData({
                "item.has_like": true,
                "item.lick_num": parseInt(c) + 1,
            });
        }).catch(err => {

        })
    },

    preImg(evt) {
        const { imgs, current } = evt.currentTarget.dataset
        wx.previewImage({
            urls: imgs.map(o => o.url),
            current,
        })
    },

})